Skip to content

Avoid noisy JSON seralization warning for callables (e.g. numpy ufuncs) #304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

jakevdp
Copy link
Contributor

@jakevdp jakevdp commented Nov 14, 2024

This avoids a bunch of warning log-spam, e.g.

$ ARRAY_API_TESTS_MODULE=numpy pytest -n auto array_api_tests

...

  /Users/vanderplas/github/array-api-tests/reporting.py:44: UserWarning: <function round at 0x105f66f70> (of type <class 'numpy._ArrayFunctionDispatcher'>) is not JSON-serializable. Using the repr instead.
    warnings.warn(f"{o!r} (of type {type(o)}) is not JSON-serializable. Using the repr instead.")

...

There are hundreds of such warnings that this change silences.

@jakevdp jakevdp requested a review from asmeurer November 14, 2024 22:43
@asmeurer asmeurer merged commit a3f3f37 into data-apis:master Nov 14, 2024
4 checks passed
@jakevdp jakevdp deleted the callable-repr branch November 15, 2024 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants